<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>[Generic Component Framework v3] GCF::LogMessageBranch Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<!--link href="tabs.css" rel="stylesheet" type="text/css"-->
</head><body>
 <div id="wrapper">
    <div id="logo_box">
        <a class="img_link" href="https://github.com/pnudupa/gcf" target="_blank" ><img style="float:left;margin-left:10px;margin-top:5px;margin-bottom:5px;"src="header_gcf_logo.jpg" alt="GCF LOGO"/></a>
        <a class="img_link" href="https://www.vcreatelogic.com/" target="_blank" ><img style="float:right;margin-right:10px; margin-top: 30px;" src="header_vcl_logo.jpg" alt="VCL LOGO"/></a>
        <div style="clear:both"></div>
    </div>
    <div class="nav">
        <ul>
            <li class="selectedpage">
                <a class="a-home" href="index.html" >
                    <span>Home</span>
                </a>
            </li>
            <li>
                <a class="a-classes " href="classes.html">
                    <span>All Classes</span>
                </a>
            </li>
            <li>
                <a class="a-home " href="gcf_modules.html">
                    <span>Modules</span>
                </a>
            </li>
            <li>
                <a class="a-home " href="gcf_guides_and_videos.html">
                    <span>Guides & Videos</span>
                </a>
            </li>
            <li>
                <a class="a-home " href="gcf_tools_and_inbuilt_components.html">
                    <span>Tools & Components</span>
                </a>
            </li>
        </ul>
    </div>
    <div id="main-content">
        <div class="inside">
        <div>
<!-- Generated by Doxygen 1.8.16 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>GCF</b></li><li class="navelem"><a class="el" href="class_g_c_f_1_1_log_message_branch.html">LogMessageBranch</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_g_c_f_1_1_log_message_branch-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">GCF::LogMessageBranch Class Reference<div class="ingroups"><a class="el" href="group__gcf__core.html">GCF Core Module</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Creates a branch in the log-message hierarchy.  
 <a href="class_g_c_f_1_1_log_message_branch.html#details">More...</a></p>

<p><code>#include &lt;GCF3/Log&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad2c8d52e0e4dc10fdda1d5233b643fb5"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_g_c_f_1_1_log_message_branch.html#ad2c8d52e0e4dc10fdda1d5233b643fb5">LogMessageBranch</a> (const QString &amp;context)</td></tr>
<tr class="separator:ad2c8d52e0e4dc10fdda1d5233b643fb5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a97a18cd62aa67b9d6db4c5cdd4d9de29"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_g_c_f_1_1_log_message_branch.html#a97a18cd62aa67b9d6db4c5cdd4d9de29">~LogMessageBranch</a> ()</td></tr>
<tr class="separator:a97a18cd62aa67b9d6db4c5cdd4d9de29"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This class is meant to be used on the stack for creating logical message branches for a function-context. The best way to use this class, for creating message branches, is to create an instance of this class on the 1st line of the function. After that log messages can be added to this branch by calling <a class="el" href="class_g_c_f_1_1_log.html#aee583f05fd246b458d518700612c6696">GCF::Log::info()</a>, <a class="el" href="class_g_c_f_1_1_log.html#a0683f2db44afbd398a245b75b0bc212a">GCF::Log::warning()</a>, <a class="el" href="class_g_c_f_1_1_log.html#a20785dad755436ec535ecaf7fc4c385f">GCF::Log::debug()</a>, <a class="el" href="class_g_c_f_1_1_log.html#ac0e4c2f870f2b524c16bb0e9a2509627">GCF::Log::error()</a> or <a class="el" href="class_g_c_f_1_1_log.html#a25050704c840e94355f1536f34842ac9">GCF::Log::fatal()</a>.</p>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> anotherFunction();</div>
<div class="line"><span class="keywordtype">void</span> yetAnotherFunction();</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> <span class="keyword">function</span>()</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="class_g_c_f_1_1_log_message_branch.html">GCF::LogMessageBranch</a> branch(<span class="stringliteral">&quot;function() branch&quot;</span>);</div>
<div class="line">    ::anotherFunction();</div>
<div class="line">    ::yetAnotherFunction();</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> anotherFunction()</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="class_g_c_f_1_1_log.html#adee50c8c03ae2af0037f50020b5ddb3f">GCF::Log::instance</a>()-&gt;<a class="code" href="class_g_c_f_1_1_log.html#aee583f05fd246b458d518700612c6696">info</a>(GCF_DEFAULT_LOG_CONTEXT, <span class="stringliteral">&quot;Simple log message&quot;</span>);</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> yetAnotherFunction()</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="class_g_c_f_1_1_log.html#adee50c8c03ae2af0037f50020b5ddb3f">GCF::Log::instance</a>()-&gt;<a class="code" href="class_g_c_f_1_1_log.html#aee583f05fd246b458d518700612c6696">info</a>(GCF_DEFAULT_LOG_CONTEXT, <span class="stringliteral">&quot;Simple log message&quot;</span>);</div>
<div class="line">}</div>
</div><!-- fragment --><p>If no message was logged after creation on the branch, then the branch's log message will automatically be deleted when the branch object is deleted.</p>
<dl class="section note"><dt>Note</dt><dd>Never create an instance of this class on the heap. </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ad2c8d52e0e4dc10fdda1d5233b643fb5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad2c8d52e0e4dc10fdda1d5233b643fb5">&#9670;&nbsp;</a></span>LogMessageBranch()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">GCF::LogMessageBranch::LogMessageBranch </td>
          <td>(</td>
          <td class="paramtype">const QString &amp;&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Creates a log message branch. A new instance of <a class="el" href="class_g_c_f_1_1_log_message.html">GCF::LogMessage</a> is created for representing this branch in the log-message hierarchy. The branch-message will be automatically deleted by the destructor, if no log messages were added to it.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>a string representing the context of the branch </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a97a18cd62aa67b9d6db4c5cdd4d9de29"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a97a18cd62aa67b9d6db4c5cdd4d9de29">&#9670;&nbsp;</a></span>~LogMessageBranch()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">GCF::LogMessageBranch::~LogMessageBranch </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Destructor. The branch message (created in the constructor) will automatically be destroyed, if no log-messages were added to it. </p>

</div>
</div>
</div><!-- contents -->
<div class="ttc" id="aclass_g_c_f_1_1_log_message_branch_html"><div class="ttname"><a href="class_g_c_f_1_1_log_message_branch.html">GCF::LogMessageBranch</a></div><div class="ttdoc">Creates a branch in the log-message hierarchy.</div><div class="ttdef"><b>Definition:</b> Log.h:199</div></div>
<div class="ttc" id="aclass_g_c_f_1_1_log_html_aee583f05fd246b458d518700612c6696"><div class="ttname"><a href="class_g_c_f_1_1_log.html#aee583f05fd246b458d518700612c6696">GCF::Log::info</a></div><div class="ttdeci">void info(const QString &amp;context, const QString &amp;message, const QString &amp;details=QString())</div><div class="ttdef"><b>Definition:</b> Log.h:107</div></div>
<div class="ttc" id="aclass_g_c_f_1_1_log_html_adee50c8c03ae2af0037f50020b5ddb3f"><div class="ttname"><a href="class_g_c_f_1_1_log.html#adee50c8c03ae2af0037f50020b5ddb3f">GCF::Log::instance</a></div><div class="ttdeci">static Log * instance()</div><div class="ttdef"><b>Definition:</b> Log.cpp:255</div></div>
</div>
</div>
</div>
<div class="footer_content">
<table width="100%" class="footer">
<tr>
<td align="left" width="50%">Copyright &copy; 2013-2019,
 <a class="el" href="http://www.vcreatelogic.com" target="_black">VCreate Logic Private Limited</a></td>
<td align="right" width="50%"><a class="el" href="http://www.vcreatelogic.com/products/gcf" target="_black">GCF - Generic Component Framework</a></td>
</tr>
</table>
</div>
</div>
</body>
</html>
